/**
 * There are <a href="https://github.com/thinkgem/jeesite">JeeSite</a> code generation
 */
package com.chlitina.store.modules.expert.dao;

import java.util.List;

import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import org.springframework.stereotype.Component;

import com.chlitina.store.common.persistence.BaseDao;
import com.chlitina.store.common.persistence.BaseDaoImpl;
import com.chlitina.store.modules.expert.entity.ExpertExperienceProblemSolution;

/**
 * 专家推荐方案DAO接口
 * @author liujiang
 * @version 2013-07-22
 */
public interface ExpertExperienceProblemSolutionDao extends ExpertExperienceProblemSolutionDaoCustom, CrudRepository<ExpertExperienceProblemSolution, Long> {
	@Query("select e.expertExperienceProblemSolution from ExpertExperienceProblemSolutionDetail e where e.parameter.id in (?1) and " +
			" e.expertExperienceProblemSolution.id not in(select b.expertExperienceProblemSolution.id from ExpertExperienceProblemSolutionDetail b where b.parameter.id not in (?1)) " +
			" GROUP BY e.expertExperienceProblemSolution")
	public List<ExpertExperienceProblemSolution> getByParameters(List<Long> parameters);
}

/**
 * DAO自定义接口
 * @author liujiang
 */
interface ExpertExperienceProblemSolutionDaoCustom extends BaseDao<ExpertExperienceProblemSolution> {

}

/**
 * DAO自定义接口实现
 * @author liujiang
 */
@Component
class ExpertExperienceProblemSolutionDaoImpl extends BaseDaoImpl<ExpertExperienceProblemSolution> implements ExpertExperienceProblemSolutionDaoCustom {

}
